<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<title>用下拉列表框改变字体颜色</title>
</head>

<body>
<form name="form1" method="post" action="">
  <input name="textfield" type="text" value="JavaScript从入门到精通">
  <select name="menu1" onChange="Fcolor()">
    <option value="black">黑</option>
    <option value="yellow">黄</option>
    <option value="blue">蓝</option>
    <option value="green">绿</option>
    <option value="red">红</option>
    <option value="purple">紫</option>
  </select>
</form>
<script type="text/javascript">
function Fcolor(){
	var obj=event.target;
	form1.textfield.style.color=obj.value;
}
</script>
</body>
</html>
